# -*- coding: utf-8 -*-

from urllib import parse

from flask_restful.inputs import *


def instagram_url(value):
    value = value.strip()
    value = url(value)
    p = parse.urlparse(value)
    if p.netloc != 'www.instagram.com':
        raise ValueError('Not instagram url: {}'.format(value))
    if p.scheme != 'https':
        raise ValueError('Url should use https: {}'.format(value))
    return value
